/*
 * @Author: wfl
 * @LastEditors: wfl
 * @description: 
 * @updateInfo: 本次更新内容：
 * @Date: 2021-12-06 13:51:52
 * @LastEditTime: 2021-12-08 14:31:09
 */
import { useEffect, useState } from 'react'
import * as Cesium from 'cesium';
import './App.css'
import useReact from './utils/react'
import useWall from './utils/wall'
(window as any).CESIUM_BASE_URL = '/CesBuild/';
// Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI2MzQzMDY2MS0yMjU2LTQ5NDUtODcwNi03NDg1MGZiODY3OGEiLCJpZCI6MTM1MzIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjM0Mzg3MDV9.D2MQnavnsT7KFrxLfIsZz5CpdXyVblEjr6rfF5B0pF4';

function App() {
  const [count, setCount] = useState(0)
  let [viewer, setViewer] = useState<Cesium.Viewer>()
  useEffect(() => {
    viewer = new Cesium.Viewer('cesiumContainer')
    console.log('viewer: ', viewer);

    const { entry } = useWall(viewer)
    console.log('entry: ', entry);
    
    viewer.zoomTo(entry)

  }, [])

  return (
    <div className="App">
      <div id="cesiumContainer"></div>
    </div>
  )
}

export default App
